#include "apue.h"

#define BUFFSIZE 4096

int main() {
    int rn;
    char buf[BUFFSIZE];

    while ((rn = read(STDIN_FILENO, buf, BUFFSIZE)) > 0) {
        if (write(STDOUT_FILENO, buf, rn) != rn) {
            err_sys("Write Error!");
        }
    }

    if (rn < 0) {
        err_sys("Read Error!");
    }
    exit(0);
}